#ifndef SERVER_H
#define SERVER_H

#include "ui_MainWindow.h"
//#include "../shared/PlayerStruct.h"

class QTcpServer;
class QTcpSocket;
class Player;
class MovingObject;
class Map;

class MainWindow : public QWidget, private Ui::ServerGUI
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    QTcpServer *tcpServer;
    QList<QTcpSocket *> *clientsList;
    QList<Player *> *playersList;
    QList<Bullet *> *bulletsList;
    //QList<PlayerStruct *> *clientsList;
    QList<quint16> *blockSizeList;

   // Player *player;
    Map *map;
    QGraphicsScene *xscene;
    qreal dT;

private slots:
   void About();
   void serverStart();
   void serverStop();
   void addClient();
   void removeClient();
   void readData();
   void sendData();
  // void kickPlayer();
   void kickAllPlayers();
   bool isCollision(const MovingObject* a, const MovingObject* b);
   bool isCollisionWithMap(const MovingObject* a, QPointF& point);
   bool isCollisionWithMap(const MovingObject* a);
   void GameTimer();

};



#endif
